package ua.study.selenium;

import org.openqa.selenium.Alert;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.testng.annotations.Test;
import java.util.List;

public class DeleteFilm extends ua.study.selenium.pages.TestBase {

	@Test
	public void deleteFilm() throws Exception {
		
		List <WebElement> movies = driver.findElements(By.cssSelector("a[href*='./?go=movie&id=']"));
		movies.get(0).click();
		
		WebElement removeFilm = driver.findElement(By.xpath(".//*[@id='content']/section/nav/ul/li[5]/div/div/a/img"));
		removeFilm.click();
		
		 Alert alert = driver.switchTo().alert();
		 alert.accept();
	}
}